<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"  xmlns:th="http://www.thymeleaf.org">
<head>


    <head th:replace="/common/head :: head"></head>

</head>
<body>
<!-- START PAGE CONTAINER -->
<div class="page-container">

    <!-- START PAGE SIDEBAR -->
    <div class="page-sidebar">
        <!-- START X-NAVIGATION -->
        <div th:replace="/common/left :: left"></div>
        <!-- END X-NAVIGATION -->
    </div>
    <!-- END PAGE SIDEBAR -->

    <!-- PAGE CONTENT -->
    <div class="page-content">

        <div th:replace="/common/top :: top"/>

        <!-- START BREADCRUMB -->
        <ul class="breadcrumb">
            <li><a href="#">Home</a></li>
            <li><a href="#">数据管理</a></li>
            <li class="active">导入导出列表</li>
        </ul>
        <!-- END BREADCRUMB -->

        <!-- PAGE CONTENT WRAPPER -->
        <div class="page-content-wrap">


            <div class="row">
                <div class="col-md-12">

                    <!-- START DATATABLE EXPORT -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">实例列表</h3>
                            <div class="pull-right">
                            </div>
                        </div>
                        <div class="panel-heading" style="float: right;">
                            <div class="btn-group">

                            </div>




                            <div class="btn-group pull-left" style="width: 100%;margin-bottom: 20px;">
                                <div class="btn-group" style="margin-right: 10px">
                                    <button type="button" class="btn btn-success dropdown-toggle"
                                            onclick="exportData()">
                                        <i class="fa">导出</i>
                                    </button>
                                </div>
                                <div class="btn-group" id="fileView" style="display: none">
                                    <div class="form-control file-caption kv-fileinput-caption" style="width: 400px;">
                                        <div class="file-caption-name" id="viewFileName">
                                        </div>
                                    </div>
                                </div>
                                <div class="btn btn-danger btn-file importDiv">
                                    <i class="glyphicon glyphicon-folder-open">&nbsp;请选择文件
                                        <input type="file" multiple class="file" id="importId" />
                                    </i>
                                </div>
                                <button type="button" class="btn btn-success dropdown-toggle"
                                        onclick="importData()">
                                    <i class="fa">导入</i>
                                </button>


                            </div>
                            <div class="pull-right" style="">
                                <label>环境选择:</label>
                                <div class="btn-group" style="width:180px;">
                                    <select name="envCode" class="form-control" id="envCode" aria-required="true">

                                    </select>
                                </div>
                                <label>选择应用:</label>
                                <div class="btn-group" style="width:180px;">
                                    <select name="appName" class="form-control" id="appName" aria-required="true">

                                    </select>
                                </div>
                                <label>模板选择:</label>
                                <div class="btn-group" style="width:300px;">
                                    <select name="templateKey" class="form-control" id="templateKey" aria-required="true">

                                    </select>
                                </div>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-success dropdown-toggle"
                                            onclick="loadData()">
                                        <i class="fa">查询</i>
                                    </button>
                                </div>
                            </div>
                        </div>

                        <div class="panel-body">
                            <div class="table-responsive">
                                <table id="dataTables-userInfo" class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th width="5%">id</th>
                                        <th width="4%">操作人</th>
                                        <th width="4%">环境</th>
                                        <th width="10%" >应用</th>
                                        <th width="10%">模板keys</th>
                                        <th  width="5%">类型</th>
                                        <th  width="7%">创建时间</th>
                                        <th  width="18%">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="tbody">

                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <!-- END DATATABLE EXPORT -->

                </div>
            </div>

        </div>
        <!-- END PAGE CONTENT WRAPPER -->
    </div>
    <!-- END PAGE CONTENT -->
</div>
<!-- END PAGE CONTAINER -->

<div id="toolbar">

</div>

<div class="modal fade" id="userInfoDelModal" tabindex="-1" role="dialog"
     aria-labelledby="userInfoDelModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="userInfoDelModalLabel">删除认证</h4>
            </div>
            <div class="modal-body">
                <input id="userInfoId" type="hidden">
                确定要删除么？
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="userInfoDel()">删除</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="editModal" tabindex="-1" role="dialog"
     aria-labelledby="userInfoEditModalLabel"
     aria-hidden="false"
     data-backdrop='static'
    >
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="userInfoEditModalLabel">修改</h4>
            </div>
            <div class="modal-body">
                <form id="userInfoEditForm">
                    <input type="hidden" id="configId"  name="id"/>
                    环境:
                    <input type="text" class="form-control" name="configKey" id="editEnvCode" placeholder="标题" >
                    应用:
                    <input type="text" class="form-control" name="title" id="editAppName" maxlength="64" placeholder="标题" />
                    类型:
                    <select name="status" class="form-control" id="editDataType" aria-required="true" >
                        <option value="1">导出</option>
                        <option value="0">导入</option>
                    </select>
                    json:
                    <textarea type="text" class="form-control" name="description" id="editJson" style="width: 100%;height: 400px;"  placeholder="描述" ></textarea>
                    <input type="reset" name="addReset" style="display: none;"/>
                    <input type="reset" name="editReset" style="display: none;"/>
                </form>
                <div id="editPropertyDiv" style="margin-top: 20px">

                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <!--<button type="button" class="btn btn-primary" onclick="userInfoEdit()">修改</button>-->
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="addModal" tabindex="-1" role="dialog"
     aria-labelledby="userInfoAddModalLabel"
     aria-hidden="true" data-backdrop='static' >
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="userInfoAddModalLabel">新增</h4>
            </div>
            <div class="modal-body">
                <form id="templateAddForm">
                    环境:
                    <input type="text" class="form-control" name="configKey" id="" placeholder="标题" >
                    应用:
                    <input type="text" class="form-control" name="title" id="addTitle" maxlength="64" placeholder="标题" />
                    类型:
                    <select name="status" class="form-control" id="addStatus" aria-required="true">
                        <option value="1">导出</option>
                        <option value="0">导入</option>
                    </select>
                    json:
                    <textarea type="text" class="form-control" name="description" id="addDescription"  placeholder="描述" ></textarea>
                    <input type="reset" name="addReset" style="display: none;"/>
                </form>
                <div id="addPropertyDiv" style="margin-top: 20px">

                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="addValue()">新建</button>
            </div>
        </div>
    </div>
</div>

<div th:replace="/common/footer :: footer"/>


<script type="text/javascript" th:src="@{/js/admin/value/data.js}"></script>
<script type="text/javascript" th:src="@{/js/ajaxfileupload.js}"></script>



</body>
</html>






